home *** CD-ROM | disk | FTP | other *** search
- Inkey 1.1
- Copyright (c) 1985 by
- Unique Software
- P.O. Box 26613
- Fort Worth, Texas 76126
- CompuServe 70130,330
- American People Link OKS688
- MCI MAIL 252-8689
-
- What is INKEY?
-
- INKEY is a handy tool for your BATch files. With INKEY you can
- allow a user to press not only "Y" and "N", like several utilities you
- may have seen, but also any other KEYS you may choose. Therefore you
- could even build a menu in a BATch file. INKEY can also simulate the
- ECHO command and send ANSI sequences for making INKEY colorful. INKEY
- can simulate the PAUSE statement, allowing you to press any key.
-
- INKEY format
-
- INKEY [options] [[\|/]prompt] [;]
- [options]
- ! any keypress is acceptable
- @ no keypress is needed (behave like ECHO)
- ^(A-Z) keypress may be CTRL (A-Z)
- characters = keypress must be one of these or above
- [all letter keypresses are upper-cased]
- [[\|/]prompt]
- ~ translated to ESCape, ASCII 27
- /prompt - prompt is flush left
- \prompt - prompt is centered
- [;] no ending CR LF sequence
-
- examples:
- INKEY !/Press any key to continue... (simulate PAUSE)
- INKEY !\Press a key to proceed ... (centered on screen)
- INKEY !/Press any key to FORMAT disk in drive A:
- The "!" makes any key pressed valid.
-
- INKEY @ (generate a blank line)
- INKEY @/Option Menu:
- The "@" makes INKEY perform like ECHO.
-
- INKEY ^U/Press CTRL-U to continue
- INKEY ^F\Press CTRL-F to continue (centered)
- The "^" preceding any alpha character makes the valid
- keypress a control-key combination.
-
- INKEY DKI/[D]elete, [K]eep, or more [I]nformation
- INKEY YN/Would you like to continue [Y?N]
- INKEY 12/Format 1 or 2 drives?
- Any other alphanumeric keys are the valid keypresses for
- INKEY.
-
- INKEY @/This message will be on one line;
- INKEY @/with ~[34mBlue and ~[31mRed.
- A terminating ";" on the prompt prevents a new line
- from being generated at the end of a prompt.
- And if you have an ANSI.SYS driver loaded the tilde, "~" is
- translated into an ESCape so that you can send ANSI
- sequences.
-
- What good does the keypress do?
-
- INKEY returns the ASCII value of the keypress as an DOS error
- code. This error code can be determined within a BATch file with the
- ERRORLEVEL command and then branch with the GOTO command. For example:
- INKEY DKI/[D]elete, [K]eep, or more [I]nformation
- IF ERRORLEVEL=75 GOTO keep
- IF ERRORLEVEL=73 GOTO info
- IF ERRORLEVEL=4 GOTO delete
- WARNING: ERRORLEVEL checks should be done from the HIGHEST ASCII
- value to the LOWEST. If we tested 'ERRORLEVEL=4' first in the above
- example, the BATch file would ALWAYS branch to the label ':delete'
-
- Replaceable paramters in BATch files
-
- INKEY is compatible with the BATch handler in DOS. That is to say,
- you can include the replaceable parameters, e.g. %4, within the INKEY
- prompt string and they will be printed out as within any batch file.
- For example:
- INKEY @/%1 should not be run until later.
- in a BATch file called RUN.BAT and the user types:
- RUN PROGRAM
- then INKEY will display
- PROGRAM should not be run until later.
-
- For more information on BATch files and ANSI sequences see your
- DOS manual.
-
- Quick Reference
-
- For quick reference just type "INKEY" at your DOS prompt.
-
- Shareware and Unique Software
-
- The files contained herein are distributed on two concepts.
- The first concept, the Shareware concept, provides that this
- software is to be freely distributed in an un-modified state. You are
- encouraged to copy, give, upload any of our un-modified software to
- any person, bulletin board or entity. The second concept, we
- call "Aware", is that Unique Software should provide valuable,
- useful, and/or entertaining software, programming techniques, and/or
- information.
- The first concept works only if the second concept is fulfilled by
- us. We do not require or set a "donation." We do not distribute
- software and expect "charity" in return. Instead, we only want
- payment from those who feel that our software, programming techniques,
- and/or information is valuable, useful, and/or entertaining. The
- amount? How valuable, useful, and/or entertaining is it to you?
- We only ask two things from our users. First, that you foward
- your name and address with any payment you might make. (This will
- enable us to inform you of any upgrade or bugs found.) Along with
- any suggestions or comments on the program. Second, Enjoy!
-
-